/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package HTML;

/**
 *
 * @author Jhon
 */
public class HtmlBody {
    private String head;
    private String main;
    private String usuario;
    private String content;
    private String sideBar;
    private String end;
    public HtmlBody(String titulo){
        head="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN \n" +
                "http://www.w3.org/TR/html4/loose.dtd\"> \n" +
                "<html> \n" +
                "<head>\n" +
                "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n" +
                "<title>"+titulo+"</title>\n" +
                "<style type=\"text/css\">\n" +
                getStile() +
                "</style>\n" +
                "</head>\n";

        main="<body>\n" +
                "<div id=\"masthead\">\n" +
                //LOGOS
                "<center><img src=\"/OnlineJudge-war/Images/UN.gif\" width=\"600\" height=\"100\">\n" +
                "</center>\n" +
                //NAVEGACION GLOBAL
                "<div id=\"globalNav\" ><center>"
                +"<form name=\"form3\" method=\"post\" action=\"\"> \n"
                +"<label> \n"
                +    "<a href=\"/OnlineJudge-war/Inicio/index.jsp\"><input type=\"image\" name=\"imageField3\" src=\"/OnlineJudge-war/Images/Home.png\"> </a>\n"
                +"</label> \n"
                +"<label> \n"
                +    "<a href=\"/OnlineJudge-war/Problemas/ListaProblemas.jsp\"><input type=\"image\" name=\"imageField3\" src=\"/OnlineJudge-war/Images/Problems.png\"> </a>\n"
                +"</label> \n"
                +"<label> \n"
                +    "<a href=\"/OnlineJudge-war/Contest/BuscarContest.jsp\"><input type=\"image\" name=\"imageField3\" src=\"/OnlineJudge-war/Images/Contest.png\"> </a>\n"
                +"</label> \n"
                +"<label> \n"
                +    "<a href=\"/OnlineJudge-war/Problemas/Summit.jsp\"><input type=\"image\" name=\"imageField4\" src=\"/OnlineJudge-war/Images/Submit.png\"> </a>\n"
                + "</label> \n"
                + "</form></center> \n"
                +"</div> \n";

        usuario="";
        content="\n</div>\n<div id=\"content\">\n";
        sideBar="</div>\n"+
                "<div id=\"navBar\">\n";
        end="</div>\n"+"<div id=\"siteInfo\"><a href=\"#\">About Us</a> | <a href=\"#\">Site Map</a> | <a href=\"#\">Contact US</a> | &copy;2010 Arquitectura </div>\n" +
                "<br>\n"+
                "</body>\n"+
                "</html>\n";
    }

    public HtmlBody(String titulo,String nombre){
        head="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN \n" +
                "http://www.w3.org/TR/html4/loose.dtd\"> \n" +
                "<html> \n" +
                "<head>\n" +
                "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n" +
                "<title>"+titulo+"</title>\n" +
                "<style type=\"text/css\">\n" +
                getStile() +
                "</style>\n" +
                "</head>\n";

        main="<body>\n" +
                "<div id=\"masthead\">\n" +
                //LOGOS
                "<center><img src=\"/OnlineJudge-war/Images/UN.gif\" width=\"600\" height=\"100\">\n" +
                "</center>\n" +
                "<div id=\"globalNav\" ><center>"
                +"<form name=\"form3\" method=\"post\" action=\"\"> \n"
                +"<label> \n"
                +    "<a href=\"/OnlineJudge-war/Inicio/index.jsp\"><input type=\"image\" name=\"imageField3\" src=\"/OnlineJudge-war/Images/Home.png\"> </a>\n"
                +"</label> \n"
                +"<label> \n"
                +    "<a href=\"/OnlineJudge-war/Problemas/ListaProblemas.jsp\"><input type=\"image\" name=\"imageField3\" src=\"/OnlineJudge-war/Images/Problems.png\"> </a>\n"
                +"</label> \n"
                +"<label> \n"
                +    "<a href=\"/OnlineJudge-war/Contest/BuscarContest.jsp\"><input type=\"image\" name=\"imageField3\" src=\"/OnlineJudge-war/Images/Contest.png\"> </a>\n"
                +"</label> \n"
                +"<label> \n"
                +    "<a href=\"/OnlineJudge-war/Problemas/Summit.jsp\"><input type=\"image\" name=\"imageField4\" src=\"/OnlineJudge-war/Images/Submit.png\"> </a>\n"
                + "</label> \n"
                +"<label> \n"
                +    "<a href=\"/OnlineJudge-war/Inicio/CerrarSesion.jsp\"><input type=\"image\" name=\"imageField4\" src=\"/OnlineJudge-war/Images/Logout.png\"> </a>\n"
                + "</label></center> \n"
                + "</form> \n"
                +"</div> \n";
        usuario="";
        content="\n</div>\n<div id=\"content\">\n";
        sideBar="</div>\n"+
                "<div id=\"navBar\">\n";
         end="</div>\n"+"<div id=\"siteInfo\"><a href=\"#\">About Us</a> | <a href=\"#\">Site Map</a> | <a href=\"#\">Contact US</a> | &copy;2010 Arquitectura </div>\n" +
                "<br>\n"+
                "</body>\n"+
                "</html>\n";
    }

    public void addContent(String c){
        content+=c;
    }
    public void addSideBar(String s){
        sideBar+=s;
    }

    public String getHtml(){
        return head + main+usuario + content + sideBar + end;
    }

    public void addUsuario(String name,String rol){
        usuario+="<br><div id=\"globalNav\"><strong>Name:</strong>"+name+"  <strong>Role:</strong> "+rol+" </div>\n";

    }


    public String getStile(){
        return "body{ \n" +
                "font-family: Arial,sans-serif;\n" +
                "color: #333333;\n" +
                "line-height: 1.166;\n" +
                "margin: 0px;\n" +
                "padding: 0px;\n" +
                "}\n" +
                "a:link, a:visited, a:hover {\n" +
                "color: #006699;\n" +
                "text-decoration: none;\n" +
                "}\n" +

                "a:hover {\n" +
                "text-decoration: underline;\n" +
                "}\n" +
/* overrides decoration from previous rule for hovered links */

                "h1, h2, h3, h4, h5, h6 {\n" +
                "font-family: Arial,sans-serif;\n" +
                "margin: 0px;\n" +
                "padding: 0px;\n" +
                "}\n" +

                "h1{\n" +
                "font-family: Verdana,Arial,sans-serif;\n" +
                "font-size: 120%;\n" +
                "color: #334d55;\n" +
                "}\n" +

                "h2{\n" +
                "font-size: 114%;\n" +
                "color: #006699;\n" +
                "}\n" +

                "h3{\n" +
                "font-size: 100%;\n" +
                "color: #334d55;\n" +
                "}\n" +

                "h4{\n" +
                "font-size: 100%;\n" +
                "font-weight: normal;\n" +
                "color: #333333;\n" +
                "}\n" +

                "h5{\n" +
                "font-size: 100%;\n" +
                "color: #334d55;\n" +
                "}\n" +

                "ul{\n" +
                "list-style-type: square;\n" +
                "}\n" +

                "ul ul{\n" +
                "list-style-type: disc;\n" +
                "}\n" +

                "ul ul ul{\n" +
                "list-style-type: none;\n" +
                "}\n" +

                "label{\n" +
                "font: bold 100% Arial,sans-serif;\n" +
                "color: #334d55;\n" +
                "}\n" +


/***********************************************/
/* Layout Divs                                 */
/***********************************************/

                "#masthead{\n" +
                "margin: 0;\n" +
                "padding: 10px 0px;\n" +
                "border-bottom: 1px solid #cccccc;\n" +
                "width: 100%;\n" +
                "}\n" +

                "#navBar{\n" +
                "margin: 0 0 0 79%;\n" +
                "padding: 0px;\n" +
                "background-color: #eeeeee;\n" +
                "border-left: 1px solid #ccc;\n" +
                "border-bottom: 1px solid #ccc;\n" +
                "}\n" +

                "#content{\n" +
                "float:left;\n" +
                "width: 75%;\n" +
                "margin: 0;\n" +
                "padding: 0 3% 0 0;\n" +
                "}\n" +


/***********************************************/
/*Component Divs                               */
/***********************************************/

            "#siteName{\n" +
                "margin: 0px;\n" +
                "padding: 0px 0px 10px 10px;\n" +
            "}\n" +


/*************** #pageName styles **************/

            "#pageName{\n" +
                "padding: 0px 0px 10px 10px;\n" +
            "}\n" +


/************* #globalNav styles **************/

            "#globalNav{\n" +
                "color: #000000;\n" +
                "padding: 0px 0px 0px 10px;\n" +
                "white-space: nowrap;\n" +
                "background-color: #eeeeee;\n" +
            "}\n" +
/* 'nowrap' prevents links from line-wrapping if there are too many to fit in one line
   this will force a horizontal scrollbar if there isn't enough room for all links
   remove rule or change value to 'normal' if you want the links to line-wrap */

            "#globalNav img{\n" +
                "display: block;\n" +
            "}\n" +

            "#globalNav a {\n" +
                "font-size: 90%;\n" +
                "padding: 0px 4px 0px 0px; \n" +
            "}\n" +


/************* #breadCrumb styles *************/

            "#breadCrumb{\n" +
                "font-size: 80%;\n" +
                "padding: 5px 0px 5px 10px;\n" +
            "}\n" +


/************** .feature styles ***************/

            ".feature{\n" +
                "padding: 0px 0px 10px 10px;\n" +
                "font-size: 80%;\n" +
            "}\n" +

            ".feature h3{\n" +
                "padding: 30px 0px 5px 0px;\n" +
                "text-align: center;\n" +
            "}\n" +

            ".feature img{\n" +
                "float: left;\n" +
                "padding: 0px 10px 0px 0px;\n" +
                "margin: 0 5px 5px 0;\n" +
            "}\n" +
/* adjust margins to change separation between the feature image and text flowing around it */


/************** .story styles *****************/

            ".story{\n" +
                "clear: both;\n" +
                "padding: 10px 0px 0px 10px;\n" +
                "font-size: 80%;\n" +
            "}\n" +

            ".story p{\n" +
                "padding: 0px 0px 10px 0px;\n" +
            "}\n" +


/************* #siteInfo styles ***************/

        "#siteInfo{\n" +
               "clear: both;\n" +
               "border: 1px solid #cccccc;\n" +
               "font-size: 75%;\n" +
                "color: #cccccc;\n" +
                "padding: 10px 10px 10px 10px;\n" +
                "margin-top: 0px;\n" +
        "}\n" +
/* negative top margin pulls siteinfo up so its top border overlaps (and thus lines up with)
   the bottom border of the navBar in cases where they "touch" */

        "#siteInfo img{\n" +
                "padding: 4px 4px 4px 0px;\n" +
                "vertical-align: middle;\n" +
        "}\n" +


/************* #search styles ***************/

        "#search{\n" +
                "padding: 5px 0px 5px 10px;\n" +
                "border-bottom: 1px solid #cccccc;\n" +
                "font-size: 90%;\n" +
        "}\n" +

        "#search form{\n" +
                "margin: 0px;\n" +
                "padding: 0px;\n" +
        "}\n" +

        "#search label{\n" +
            "display: block;\n" +
            "margin: 0px;\n" +
            "padding: 0px;\n" +
        "}\n" +


/*********** #navBar link styles ***********/

        "#navBar ul a:link, #navBar ul a:visited {display: block;}\n" +
        "#navBar ul {list-style: none; margin: 0; padding: 0;}\n" +

/* hack to fix IE/Win's broken rendering of block-level anchors in lists */
        "#navBar li {border-bottom: 1px solid #EEE;}\n" +

/* fix for browsers that don't need the hack */
        "html>body #navBar li {border-bottom: none;}\n" +


/*********** #sectionLinks styles ***********/

        "#sectionLinks{\n" +
            "position: relative;\n" +
            "margin: 0px;\n" +
            "padding: 0px;\n" +
            "border-bottom: 1px solid #cccccc;\n" +
            "font-size: 90%;\n" +
        "}\n" +

        "#sectionLinks h3{\n" +
            "padding: 10px 0px 2px 10px;\n" +
        "}\n" +

        "#sectionLinks a:link{\n" +
            "padding: 2px 0px 2px 10px;\n" +
            "border-top: 1px solid #cccccc;\n" +
            "width: 100%;\n" +
            "voice-family: \"\\\"}\\\"\"; \n" +
            "voice-family:inherit;\n" +
            "width: auto;\n" +
        "}\n" +

        "#sectionLinks a:visited{\n" +
            "border-top: 1px solid #cccccc;\n" +
            "padding: 2px 0px 2px 10px;\n" +
        "}\n" +

        "#sectionLinks a:hover{\n" +
            "border-top: 1px solid #cccccc;\n" +
            "background-color: #dddddd;\n" +
            "padding: 2px 0px 2px 10px;\n" +
        "}\n" +


/*********** .relatedLinks styles ***********/

        ".relatedLinks{\n" +
            "margin: 0px;\n" +
            "padding: 0px 0px 10px 10px;\n" +
            "font-size: 90%;\n" +
        "}\n" +

        ".relatedLinks h3{\n" +
            "padding: 10px 0px 2px 0px;\n" +
        "}\n" +


/************** #advert styles **************/

        "#advert{\n" +
            "padding: 10px 0px 0px 10px;\n" +
            "font-size: 80%;\n" +
            "border-top: 1px solid #cccccc;\n" +
        "}\n" +

        "#advert img{\n" +
            "display: block;\n" +
        "}\n" +


/************** #headlines styles **************/

        "#headlines{\n" +
            "margin: 0px;\n" +
            "padding: 10px 0px 20px 10px;\n" +
            "font-size: 80%;\n" +
        "}\n" +

        "#headlines p{\n" +
            "padding: 5px 0px 5px 0px;\n" +
        "}\n";




    }


}
